Xbasic

argumentsFromJSON Function

Syntax

argumentsFromJSON(args as SQL::Arguments, json as C)

Arguments

argsSQL::Arguments

SQL::Arguments object to which the arguments will be added.

jsonCharacter

The JSON Object containing the data to append to the SQL::Arguments args object.

Description

Appends arguments to an argument object from a JSON argument definition

Example

dim json as c = "[{name: 'firstname',value: 'John',type: 'C'},{name: 'lastname',value: 'Smith',type: 'C'}]"
dim args as SQL::Arguments

argumentsfromjson(args,json)

? args.XML
= <SQLArguments>
	<SQLArgument>
		<Name>firstname</Name>
		<Data Type="C">John</Data>
		<IsNull Type="L">0</IsNull>
		<Usage>Input</Usage>
	</SQLArgument>
	<SQLArgument>
		<Name>lastname</Name>
		<Data Type="C">Smith</Data>
		<IsNull Type="L">0</IsNull>
		<Usage>Input</Usage>
	</SQLArgument>
</SQLArguments>

See Also